<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of mmw_core_ApplicationRegistry
 *
 * @author Manu
 */
class mmw_core_ApplicationRegistry {

    private static $instance;
    private $values = array();

    private function _construct() {
        
    }

    public static function instance() {
        if (!isset(self::$instance)) {
            self::$instance = new self();
            self::$instance->loadConfigFile();
        }
        return self::$instance;
    }

    private function loadConfigFile() {
        $this->values = parse_ini_file("mmw.ini");
    }

    protected function get($key) {
        if (isset($this->values[$key]))
                return $this->values[$key];
        else return null;
    }

    public static function getKey($key) {
        return self::instance()->get($key);
    }

    public static function setKey($key, $value) {
        //Todo...
    }

}

?>
